﻿# coding: UTF-8
'''
Created on 2011/04/26

@author: yang_wanjun
'''
from django.conf.urls.defaults import patterns, url
from senbzblog.blog.admin import admin_view

urlpatterns = patterns('',
    url(r'^(?P<username>\w+)/$', admin_view.index, name='admin_index'), #后台管理页面
    
    #article
    url(r'^(?P<username>\w+)/article$', admin_view.article, name='admin_show_article'), #跳转到文章添加页面
    url(r'^(?P<username>\w+)/article/quick-post', admin_view.article_quick_post, name="admin_quick_post"),
    url(r'^(?P<username>\w+)/article/(?P<slug>\w+((-)*\w*)*).html$', admin_view.article_edit, name='admin_edit_article'),
    url(r'^(?P<username>\w+)/article/save$', admin_view.article_save, name='admin_save_article'),
    url(r'^(?P<username>\w+)/articles$', admin_view.articles, name='admin_show_articles'),
    url(r'^(?P<username>\w+)/pubed-articles$', admin_view.articles_published, name='admin_show_articles_published'),
    url(r'^(?P<username>\w+)/unpub-articles$', admin_view.articles_unpublished, name='admin_show_articles_unpublished'),
    url(r'^(?P<username>\w+)/articles/delete$', admin_view.articles_delete, name='admin_delete_articles'),
    url(r'^(?P<username>\w+)/article/delete/(?P<id>\d+)$', admin_view.article_delete, name='admin_delete_article'),
    
    #category
    url(r'^(?P<username>\w+)/categories$', admin_view.categories, name='admin_show_categories'),
    url(r'^(?P<username>\w+)/category/save$', admin_view.category_save, name='admin_save_category'),
    url(r'^(?P<username>\w+)/editcategory/(?P<slug>\w+((-)*\w*)*).html$', admin_view.category, name='admin_show_category'),
    url(r'^(?P<username>\w+)/category/delete$', admin_view.category_delete, name='admin_delete_category'),
    
    #tag
    url(r'^(?P<username>\w+)/tags', admin_view.tags, name='admin_show_tags'),
    
    #media
    url(r'^(?P<username>\w+)/media$', admin_view.media, name='admin_media'),
#    url(r'^(?P<username>\w+)/media/backup_db$', admin_view.media_backup_db, name='admin_backup_db'),
    
    #comments
    url(r'^(?P<username>\w+)/comments(.html){0,1}$', admin_view.comments, name='admin_comments'),
    url(r'^(?P<username>\w+)/comments-spam(.html){0,1}$', admin_view.comments_spam, name='admin_comments_span'),
    url(r'^(?P<username>\w+)/comments/delete$', admin_view.comments_delete, name='admin_delete_comments'),
    url(r'^(?P<username>\w+)/comment/delete/(?P<id>\d+)$', admin_view.comment_delete, name='admin_delete_comment'),
    url(r'^(?P<username>\w+)/comment/edit/(?P<id>\d+)$', admin_view.comment_edit, name='admin_edit_comment'),
    url(r'^(?P<username>\w+)/comment/save/(?P<id>\d+)$', admin_view.comment_save, name='admin_save_comment'),
    url(r'^(?P<username>\w+)/comment_spam/(?P<id>\d+)', admin_view.comment_to_spam, name="admin_comment_to_spam"),
    
    #links
    url(r'^(?P<username>\w+)/links(.html){0,1}$', admin_view.links, name='admin_links'),
    url(r'^(?P<username>\w+)/link/add(.html){0,1}$', admin_view.link_save, name='admin_add_link'),
    url(r'^(?P<username>\w+)/link/edit/(?P<id>\d+)(.html){0,1}$', admin_view.link, name='admin_edit_link'),
    url(r'^(?P<username>\w+)/links/delete$', admin_view.links_delete, name='admin_delete_links'),
    
    #pages
    url(r'^(?P<username>\w+)/page$', admin_view.page, name='admin_show_page'),
    url(r'^(?P<username>\w+)/pages$', admin_view.pages, name='admin_show_pages'),
    url(r'^(?P<username>\w+)/page/save$', admin_view.page_save, name='admin_save_page'),
    url(r'^(?P<username>\w+)/page/(?P<slug>\w+((-)*\w*)*).html$', admin_view.page_edit, name='admin_edit_page'),
    url(r'^(?P<username>\w+)/page/delete/(?P<slug>\w+((-)*\w*)*)$', admin_view.page_delete, name='admin_delete_page'),
    url(r'^(?P<username>\w+)/pubed-pages$', admin_view.page_published, name='admin__pages_published'),
    url(r'^(?P<username>\w+)/unpub-pages$', admin_view.page_unpublished, name='admin_pages_unpublished'),
    
    #user
    url(r'^(?P<username>\w+)/user(.html){0,1}$', admin_view.users, name='admin_user'),
    url(r'^(?P<username>\w+)/profile(.html){0,1}$', admin_view.user, name='admin_profile'),
    url(r'^(?P<username>\w+)/profile/save(.html){0,1}$', admin_view.user_save, name='admin_save_profile'),
    url(r'^(?P<username>\w+)/changepassword(.html){0,1}$', admin_view.user_change_password, name='admin_change_password'),
    
    #setting
    url(r'^(?P<username>\w+)/settings(.html){0,1}$', admin_view.settings, name='admin_settings'),
    url(r'^(?P<username>\w+)/settings/save(.html){0,1}$', admin_view.settings_save, name='admin_settings_save'),
    
#    #login logout
#    url(r'^accounts/login', admin_view.login, name='login'),
#    url(r'^accounts/logout$', admin_view.logout, name='logout'),
)
